/*
2019.9.18
*/ 
#include<iostream>
#include<string>
using std::cin;
using std::cout;
using std::endl;
using std::string; 
class Solution {
public:
    int lengthOfLastWord(string s) {
        if(s.size()==0)
        {
        	return 0;
		}
		
		int sum=1;
		for(int i=s.size()-1;i>=0;i--)
		{
			if(s[i]==' ')
			{
				break;
			}
			sum++;
		}
		return sum;
		
    }
};
int main()
{
	
	return 0;
}
